﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/admincp.Master" AutoEventWireup="true" CodeBehind="OrderStatus.aspx.cs" Inherits="VINETLIFE.AdminCP.OrderStatus" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function SelectAndClosePopup(value) {
            cbCategory.SetValue(value);
            pcParent.Hide();
        }
    </script>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function OnClientPasteHtml(sender, args) {
                var commandName = args.get_commandName();
                var value = args.get_value();
                if (commandName == "ImageManager") {
                    //See if an img has an alt tag set
                    var div = document.createElement("DIV");
                    //Do not use div.innerHTML as in IE this would cause the image's src or the link's href to be converted to absolute path.
                    //This is a severe IE quirk.
                    Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div, value);
                    //Now check if there is alt attribute
                    var img = div.firstChild;
                    //alert(div.innerHTML);

                    //Set new content to be pasted into the editor

                    if (!!img.alt) {
                        var newInner = "<center>";
                        newInner = newInner + "<img src='" + img.src + "' alt='" + img.alt + "'/></center><center>";
                        newInner = newInner + img.alt + "</center>";

                        args.set_value(newInner);
                    }
                    else {
                        var newInner = "<center><img src='" + img.src + "' alt='Vinetlife'/></center><br/>";

                        args.set_value(newInner);
                    }

                }
            }
        </script>
    </telerik:RadCodeBlock>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <h2>
        Thêm mới trạng thái đơn hàng</h2>
    <table class="tablet">
        <tr>
            <td class="style8" style="width: 150px;">
                Trạng thái đơn hàng:
            </td>
            <td class="style9" colspan="3">
                <asp:TextBox ID="txtTrangThaiDH" runat="server" Width="350px" ValidationGroup="submitGrp"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTrangThaiDH"
                    ErrorMessage="*** Cần nhập trạng thái đơn hàng" ValidationGroup="submitGrp"></asp:RequiredFieldValidator>
            </td>
        </tr>
      <tr>
            <td class="style8" style="width: 150px;">
                Mã trạng thái:
            </td>
            <td class="style9" colspan="3">
                <asp:TextBox ID="txtMaTrangThai" runat="server" Width="350px" ValidationGroup="submitGrp"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtMaTrangThai"
                    ErrorMessage="*** Cần nhập mã trạng thái" ValidationGroup="submitGrp"></asp:RequiredFieldValidator>
            </td>
        </tr>
         <tr>
        <td>
            Ảnh đại diện
        </td>
        <td>
            <asp:FileUpload ID="fuImage" runat="server" />
            &nbsp; &nbsp; &nbsp;
            <asp:HyperLink ID="hplImage" runat="server" Target="_blank" Visible="False">[Xem 
            ảnh]</asp:HyperLink>
        </td>
    </tr>
         <tr runat="server" id="NgayTao" visible="false">
            <td class="style8" style="width: 150px;">
                Ngày tạo:
            </td>
            <td class="style9" colspan="3">
                <asp:TextBox ID="txtNgayTao" ReadOnly="true" runat="server" Width="350px" ValidationGroup="submitGrp"></asp:TextBox>
            </td>
        </tr>
        <tr runat="server" id="NgaySua" visible="false">
            <td class="style8" style="width: 150px;">
                Ngày sửa cuối:
            </td>
            <td class="style9" colspan="3">
                <asp:TextBox ID="txtNgaySua" ReadOnly="true" runat="server" Width="350px" ValidationGroup="submitGrp"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style8">
                Mô tả:
            </td>
            <td colspan="3">
                 <asp:TextBox ID="txtNote" runat="server" Height="102px" TextMode="MultiLine"
                Width="90%"></asp:TextBox>
              <%--  <telerik:RadEditor ID="txtMoTa" runat="server" OnClientPasteHtml="OnClientPasteHtml"
                    DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd" Width="99%" Height="700px">
                    <ImageManager MaxUploadFileSize="1024000000"></ImageManager>
                </telerik:RadEditor>--%>
            </td>
        </tr>
        <tr>
            <td class="style8">
                Số thứ tự:
            </td>
            <td class="style4" colspan="3">
                <asp:TextBox ID="txtOrderID" runat="server" Width="68px" Text="0" ValidationGroup="submitGrp"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style8">
                &nbsp;
            </td>
            <td class="style4" colspan="3">
                <asp:Button CssClass="button-gg-green" ID="btnSave" runat="server" Text="Lưu" OnClick="btnSave_Click"
                    ValidationGroup="submitGrp" />
                <asp:Button CssClass="button-gg-green" ID="btnHuy" runat="server" Text="Hủy" OnClick="btnHuy_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
